#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	char s[55];
	int n,t;
	while(scanf("%d %d",&n,&t)!=EOF)
	{
		scanf("%s",s);
		for(int i = 0;i<t;i++)
		for(int j = 0;j<n-1;j++)
		{
			if(s[j]=='B'&&s[j+1]=='G')
			{
				char m = s[j+1];
				s[j+1] = s[j];
				s[j] = m;
				j++;
			}
		}
		puts(s);
	}
} 
